package com.ruoyi.system.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.system.domain.JacTest2;
import com.ruoyi.system.service.IJacTest2Service;

/**
 * 微服务测试22 提供者
 *
 * @author ygx
 * @date 2020-06-07
 */
@RestController
@RequestMapping("test2")
public class JacTest2Controller extends BaseController
{

	@Autowired
	private IJacTest2Service jacTest2Service;

	/**
	 * 查询${tableComment}
	 */
	@GetMapping("get/{id}")
	public JacTest2 get(@PathVariable("id") Long id)
	{
		return jacTest2Service.selectJacTest2ById(id);

	}

	/**
	 * 查询微服务测试22列表
	 */
	@GetMapping("list")
	public R list(JacTest2 jacTest2)
	{
		startPage();
        return result(jacTest2Service.selectJacTest2List(jacTest2));
	}


	/**
	 * 新增保存微服务测试22
	 */
	@PostMapping("save")
	public R addSave(@RequestBody JacTest2 jacTest2)
	{
		return toAjax(jacTest2Service.insertJacTest2(jacTest2));
	}

	/**
	 * 修改保存微服务测试22
	 */
	@PostMapping("update")
	public R editSave(@RequestBody JacTest2 jacTest2)
	{
		return toAjax(jacTest2Service.updateJacTest2(jacTest2));
	}

	/**
	 * 删除${tableComment}
	 */
	@PostMapping("remove")
	public R remove(String ids)
	{
		return toAjax(jacTest2Service.deleteJacTest2ByIds(ids));
	}

}
